@extends('_layout.master')

@section('right')
    <div class="col-md-9">
        <div class="row border1">
            <div class="col-md-5">
                <span class="list-icon pull-left"></span>
                <h4 style="color: #ff6637;" class="pull-left">{{ $title }}</h4>
            </div>
        </div>
        <div class="row">
            <ul class="list-unstyled list1">
                @foreach($articles as $article)
                    <li>
                        <div class="row">
                            <div class="col-md-8">
                                <a href="{{ route('articleContent', ['id' => $article->id]) }}" class="news-title">
                                    {{ $article->title }}
                                </a>
                            </div>
                            <div class="col-md-4 text-right news-date">{{ $article->created_at->format('Y-m-d') }}</div>
                        </div>
                    </li>
               @endforeach
            </ul>
        </div>
        <div class="row text-right">
            {{ $articles->links() }}
        </div>
    </div>
@endsection

@section('script')
    <script>
        $(function () {

            $('.news-title').mouseover(function () {
                $(this).css('color', '#ff6637');
                $(this).parent().next('div').css('color', '#ff6637');
            });
            $('.news-title').mouseout(function () {
                $(this).css('color', '#666666');
                $(this).parent().next('div').css('color', '#666666');
            });

            $('#login').click(function () {
                $('#alert-msg .modal-body').html('<h5>用户名密码错误！</h5>');
                $('#alert-msg').modal();
            });
        });
    </script>
@endsection